1. Field of the Invention
This invention relates generally to video processing and more particularly to providing real-time shading model for rendering objects on a display.
2. Description of the Related Art
Game developers are constantly refining image synthesis to create a technique that presents a realistic visual impression for users. One aspect of image synthesis that is used to present a realistic visual impression is the accurate portrayal of shadows and shading. Normal lighting for computer games rely on vector dot product calculations, which are relatively simple, but inaccurate. While the vector dot product calculations are able to present hard edge shadows, theses type of calculations cannot present soft edge shadows.
FIG. 1 is a schematic diagram representing an exemplary lighting computation scheme for rendering a display. Light source 100 includes a number of points that emit light. Occlusion surface 102 blocks a portion of the light from light source 100 that is directed to surface 104. Thus, a hard edge shadow (the umbra) is defined by region 106 from occlusion surface 102. However, point 110, which lies in soft shadow (or penumbra) region 108, requires that multiple points on light source 100 be picked out and the shadow projection for each of the points is determined. Each of the shadow projections is then summed, therefore, with respect to point 110 the summation of a number of lighting functions is required to realistically display points in soft shadow region 108. However, the calculation and summation of the lighting functions are computationally intensive and not viable alternatives for presenting realistic shading in real time. Furthermore, adding another light source, which is common especially in video games, requires another complete calculation.
One attempt to address this shortcoming is the use of a special case list which may be used to define the shading properties when certain criteria are met. However, the special case list is not exhaustive and as a result the list must be updated for each new situation. Moreover, the attempt to force a particular situation to fit a special case may result in sub-optimal display quality. Additionally, the special case list acts as a restriction on the game developer.
As a result, there is a need to solve the problems of the prior art to provide a method and apparatus for providing a shading scheme capable of rendering a realistic representation in real time.